package com.noexcs.forum.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author noexcs
 * @since 5/20/2022 5:59 PM
 */
@Data
@Document(indexName = "discusspost")
public class DiscussPost {

    /**
     * 帖子id
     */
    @Id
    private int id;

    /**
     * 用户id
     */
    @Field(type = FieldType.Integer)
    private int userId;

    /**
     * 帖子标题
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String title;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String content;

    /**
     * 帖子类型： 0 普通 1 置顶
     */
    @Field(type = FieldType.Integer)
    private int type;

    /**
     * 0 正常 1 精华 2 拉黑
     */
    @Field(type = FieldType.Integer)
    private int status;

    /**
     * 评论数量
     */
    @Field(type = FieldType.Integer)
    private int commentCount;

    @Field(type = FieldType.Date)
    private Date createTime;

    /**
     * 分数
     */
    @Field(type = FieldType.Double )
    private double score;
}
